/*
 * Copyright (C) 2003, Velocityme Partnership
 * TransitionValueToString.java
 *
 * Created on 13 May 2003, 09:18
 */

package com.velocityme.valueobjects;

/**
 *
 * @author  Robert Crida Work
 */
public class TransitionValueToString extends TransitionValue {
    
    /** Creates a new instance of TransitionValueToString */
    public TransitionValueToString(TransitionValue p_value) {
        super(p_value);
    }
    
    public String toString() {
        StringBuffer strBuffer = new StringBuffer();
        strBuffer.append(getSourceStateValue().getNodeValue().getName());
        strBuffer.append(" -> ");
        strBuffer.append(getDestinationStateValue().getNodeValue().getName());
        strBuffer.append(" (");
        strBuffer.append(getStatusValue().getNodeValue().getName());
        strBuffer.append(", Roles = [");
        for (int i = 0; i < this.getResponsibleRoleValues().length; i++) {
            if (i != 0)
                strBuffer.append(", ");
            strBuffer.append(getResponsibleRoleValues()[i].getNodeValue().getName());
        }
        strBuffer.append("])");
        if (getIsOwnerResponsible().booleanValue())
            strBuffer.append(" + Owner");
        if (getIsUserResponsible().booleanValue())
            strBuffer.append(" + User");
        return strBuffer.toString();
    }
}
